﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=1">
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <title>操作元素属性</title>
    <link href="../css/bootstrap.css"/>
    <link href="../css/bootstrap-theme.css"/>

    <style>
        .red{
            color: red;
        }
        .blue{
            color: blue;
        }
    </style>
</head>
<body>
    <h1>操作元素属性</h1><br/>

    <div id="app">
        <h1 v-bind:class="color">第一段文本内容</h1>
        <h1 :class="color">第二段文本内容</h1>
        <h1 :class="'blue'">第三段文本内容</h1>
        <h1 :class="{red:true}">第四段文本内容</h1>
    </div>
<script src="../js/jquery-2.2.0.min.js"></script>
<script src="../js/vue-2.5.16.js"></script>

<script>
    var app = new Vue({
        el:'#app',
        data:{
            color:'red'
        }
    });
</script>

</body>
</html>